package com.loan.market.view

import android.content.Context
import android.util.AttributeSet
import android.widget.ImageView
import android.widget.RelativeLayout
import androidx.core.view.isVisible
import androidx.core.view.updateLayoutParams
import com.loan.market.R.color
import com.scwang.smart.refresh.header.ClassicsHeader
import com.scwang.smart.refresh.header.classics.R

class RefreshHeader @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : ClassicsHeader(context, attrs) {

    init {
        rootView.findViewById<ImageView>(R.id.srl_classics_arrow).updateLayoutParams<LayoutParams> {
            addRule(RelativeLayout.CENTER_HORIZONTAL)
        }
        rootView.findViewById<ImageView>(R.id.srl_classics_progress).updateLayoutParams<LayoutParams> {
            addRule(RelativeLayout.CENTER_HORIZONTAL)
        }
        rootView.findViewById<ImageView>(R.id.srl_classics_center).isVisible = false
        setEnableLastTime(false)
        setAccentColorId(color.color_accent)
    }

}